<%--
  Created by IntelliJ IDEA.
  User: MyronLiu
  Date: 2020/12/17
  Time: 14:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page session="true" %>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet"
          type="text/css"
          href=" <c:url value="/resources/css/style.css"/> " >
    <title>Title</title>
</head>
<body>

<%@ include file="banner.jsp" %>
<div class="postView" style="margin-left: 3%;">
    <div>
        <p><c:out value="${post.topic}" /></p>
        <span class="postTime"><c:out value="${post.postedTime}" /></span>
    </div>
    <p><c:out value="${post.content}" /></p>
    <a href=" <c:url value="/comment/${postID}"/> " >跟帖</a>
    <a href=" <c:url value="/userHomePage"/>">返回</a>
</div>

    <div class="commentList">
        <ul class="commentList">
            <c:forEach items="${comments.items}" var="comment" >
                <li id="post_<c:out value="${comment.level}"/>">
                    <div class="postMessage">
                            <c:out value="${comment.content}" />
                    </div>
                    <div class="postTime">
                        <fmt:formatDate value="${comment.commentTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
                        by <c:out value="${comment.poster.userName }" /> <c:out value="${comment.commentTime}"/>
                    </div>
                </li>
            </c:forEach>
        </ul>
    </div>
    每页${comments.pageSize}条跟帖，  第${comments.currentPageNo}/${comments.totalPageCount}页,共${comments.totalCount}条跟帖
    <c:if test="${comments.previousPage}">
        <a href="<c:url value="/post/${post.postID}?pageNo=${comments.currentPageNo-1}" />" >上一页</a>
    </c:if>
    <c:if test="${comments.nextPage}">
        <a href="<c:url value="/post/${post.postID}?pageNo=${comments.currentPageNo+1}" />" >下一页</a>
    </c:if>
<%@ include file="footer.jsp" %>
</body>
</html>
